var process = function(data, target) {
	if (data.retrieve == false) {
		//add message
		$('#login-response').html(data.message);
    }
    else {
    	//add message
		$('#login-response').html(data.message);
		setTimeout( function () {
    		wait_block('body', 'WAIT');
    		setTimeout( function () {
    	 		if (parent) {
    				parent.window.location.href = data.redirect;
    	 		}
    	 		else {
    	 			window.location.href = data.redirect;
    	 		}
    	 		
    	 	}, 2000);
    	}, 2000);
    }
};


$(document).ready(function () {
	$(document).keypress(function (e) {
		key = (e.keyCode) ? e.keyCode : e.which;
		if (key === 13) {
			$('form').submit();
			return false;
		}
	});
});
